/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Heinz Hernandez
 */
@Entity
@Table(name = "vacine")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Vacine.findAll", query = "SELECT v FROM Vacine v"),
    @NamedQuery(name = "Vacine.findByVacId", query = "SELECT v FROM Vacine v WHERE v.vacId = :vacId"),
    @NamedQuery(name = "Vacine.findByVacName", query = "SELECT v FROM Vacine v WHERE v.vacName = :vacName"),
    @NamedQuery(name = "Vacine.findByVacDosage", query = "SELECT v FROM Vacine v WHERE v.vacDosage = :vacDosage")})
public class Vacine implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "VAC_ID")
    private Long vacId;
    @Basic(optional = false)
    @Column(name = "VAC_NAME")
    private String vacName;
    @Basic(optional = false)
    @Column(name = "VAC_DOSAGE")
    private float vacDosage;
    @JoinColumn(name = "REC_ID", referencedColumnName = "REC_ID")
    @ManyToOne
    private Record recId;

    public Vacine() {
    }

    public Vacine(Long vacId) {
        this.vacId = vacId;
    }

    public Vacine(Long vacId, String vacName, float vacDosage) {
        this.vacId = vacId;
        this.vacName = vacName;
        this.vacDosage = vacDosage;
    }

    public Long getVacId() {
        return vacId;
    }

    public void setVacId(Long vacId) {
        this.vacId = vacId;
    }

    public String getVacName() {
        return vacName;
    }

    public void setVacName(String vacName) {
        this.vacName = vacName;
    }

    public float getVacDosage() {
        return vacDosage;
    }

    public void setVacDosage(float vacDosage) {
        this.vacDosage = vacDosage;
    }

    public Record getRecId() {
        return recId;
    }

    public void setRecId(Record recId) {
        this.recId = recId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (vacId != null ? vacId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Vacine)) {
            return false;
        }
        Vacine other = (Vacine) object;
        if ((this.vacId == null && other.vacId != null) || (this.vacId != null && !this.vacId.equals(other.vacId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Vacine[ vacId=" + vacId + " ]";
    }
    
}
